<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>FLslidBnk2Setk</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="FLslidBnk2Set.html" title="FLslidBnk2Set" />
    <link rel="next" href="FLslider.html" title="FLslider" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">FLslidBnk2Setk</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="FLslidBnk2Set.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="FLslider.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="FLslidBnk2Setk"></a>
      <div class="titlepage"></div>
      <a id="IndexFLslidBnk2Setk" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">FLslidBnk2Setk</span>
        </h2>
        <p>FLslidBnk2Setk — 
      modify the values of a slider bank.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp107944560"></a>
        <h2>Description</h2>
        <p>
      <span class="emphasis"><em>FLslidBnk2Setk</em></span> modifies the values of a slider bank according to an array of values stored in a table.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp107946208"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>FLslidBnk2Setk</strong></span>  ktrig, ihandle, ifn [, istartIndex, istartSlid, inumSlid]</pre>
      </div>
      <div class="refsect1">
        <a id="idp107948192"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ihandle</em></span> - handle of the sliderBnk (to be used to set its values).
    </p>
        <p>
      <span class="emphasis"><em>ifn</em></span> - number of a table containing an array of values to set each slider to.
    </p>
        <p>
      <span class="emphasis"><em>istartIndex</em></span> - (optional) starting index of the table element of to be evaluated firstly. Default value is zero
    </p>
        <p>
      <span class="emphasis"><em>istartSlid</em></span> - (optional) starting slider to be evaluated. Default 0, denoting the first slider.
    </p>
        <p>
      <span class="emphasis"><em>inumSlid</em></span> - (optional) number of sliders to be updated. Default 0, denoting all sliders.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp107953472"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>ktrig</em></span> – the output of <span class="emphasis"><em>FLslidBnk2Setk</em></span> consists of a trigger that informs if sliders have to be updated or not. A non-zero value forces the slider to be updated.
    </p>
        <p>
     <span class="emphasis"><em>FLslidBnk2Setk</em></span> is similar to <a class="link" href="FLslidBnkSet.html" title="FLslidBnkSet"><em class="citetitle">FLslidBnkSet</em></a> but allows k-rate to modify the values of <a class="link" href="FLslidBnk2.html" title="FLslidBnk2"><em class="citetitle">FLslidBnk2</em></a>  (<span class="emphasis"><em>FLslidBnk2Setk</em></span> can also be used with <a class="link" href="FLvslidBnk2.html" title="FLvslidBnk2"><em class="citetitle">FLvslidBnk2</em></a>, obtaining identical result). It also allows the slider bank to be joined with MIDI. If you are using MIDI (for instance, when using the <a class="link" href="slider8table.html" title="slider8table"><em class="citetitle">slider8table</em></a> opcode), <span class="emphasis"><em>FLslidBnk2Setk</em></span> changes the values of <a class="link" href="FLslidBnk2.html" title="FLslidBnk2"><em class="citetitle">FLslidBnk2</em></a> bank of sliders to a set of values located in a table. This opcode is actually able to serve as a MIDI bridge to the <a class="link" href="FLslidBnk2.html" title="FLslidBnk2"><em class="citetitle">FLslidBnk2</em></a> widget when used together with the <span class="emphasis"><em>sliderXXtable</em></span> set of opcodes (see <a class="link" href="slider8table.html" title="slider8table"><em class="citetitle">slider8table</em></a> entry for more information). Notice, that, when you want to use table indexing as a curve response, it is not possible to do it directly in the <span class="emphasis"><em>iconfigtable</em></span> configuration of <a class="link" href="FLslidBnk2.html" title="FLslidBnk2"><em class="citetitle">FLslidBnk2</em></a>, when you intend to use the <span class="emphasis"><em>FLslidBnk2Setk</em></span> opcode. In fact, corresponding <span class="emphasis"><em>inputTable</em></span> element of <span class="emphasis"><em>FLslidBnk2Setk</em></span> must be set in linear mode and respect the 0 to 1 range. Even the corresponding elements of <span class="emphasis"><em>sliderXXtable</em></span> must be set in linear mode and in the normalized range. You can do table indexing later, by using the <a class="link" href="tab.html" title="tab"><em class="citetitle">tab</em></a> and <a class="link" href="tb.html" title="tb"><em class="citetitle">tb</em></a> opcodes, and rescaling output according to max and min values. By the other hand, it is possible to use linear and exponential curve response directly, by setting the actual min-max range and flag both in the <span class="emphasis"><em>iconfigtable</em></span> of corresponding <a class="link" href="FLslidBnk2.html" title="FLslidBnk2"><em class="citetitle">FLslidBnk2</em></a> and in <span class="emphasis"><em>sliderXXtable</em></span>.
    </p>
        <p>
      <span class="emphasis"><em>FLslidBnk2Setk</em></span> the k-rate version of <a class="link" href="FLslidBnk2Set.html" title="FLslidBnk2Set"><em class="citetitle">FLslidBnk2Set</em></a>.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp107973920"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the FLslidBnk2Setk opcode. It uses the file <a class="ulink" href="examples/FLslidBnk2Setk.csd" target="_top"><em class="citetitle">FLslidBnk2Setk.csd</em></a>.

      </p>
        <div class="example">
          <a id="idp107975808"></a>
          <p class="title">
            <strong>Example 286. Example of the FLslidBnk2Setk opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Audio out   Audio in    No messages</span>
-odac           -iadc     -d     <span class="comment">;;;RT audio I/O</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span>     <span class="op">=</span> 44100
<span class="ohdr">ksmps</span>  <span class="op">=</span> 10
<span class="ohdr">nchnls</span> <span class="op">=</span> 2

<span class="comment">;Example by Gabriel Maldonado 2007</span>
giElem	<span class="opc">init</span>	8
giOutTab	<span class="ohdr">ftgen</span>	1,0,128, 2, 	0
giSine	<span class="ohdr">ftgen</span>	3,0,256,10,	1
giOutTab2	<span class="ohdr">ftgen</span>	4,0,128, 2, 	0
itab	<span class="ohdr">ftgen</span>	29, 0, 129, 5,  .002, 128, 1		<span class="comment">;** exponential ascending curve for slider mapping</span>
giExpTab	<span class="ohdr">ftgen</span>	30, 0, 129, <span class="op">-</span>24, itab, 0, 1                    <span class="comment">;** rescaled curve for slider mapping</span>
giConfigTab <span class="ohdr">ftgen</span>	2,0,128,<span class="op">-</span>2,         	1, 	500,	<span class="op">-</span>1, 	13, \
				     	1, 	500,	<span class="op">-</span>1,  	13, \
				          1, 	500,	<span class="op">-</span>1, 	13, \
 					1, 	5000,	<span class="op">-</span>1, 	13, \
\
					1, 	1000, 	<span class="op">-</span>1,  	5, \
					1, 	1000, 	<span class="op">-</span>1,  	5, \
					1, 	1000, 	<span class="op">-</span>1,  	5, \
					1, 	5000, 	<span class="op">-</span>1,  	5

	<span class="opc">FLpanel</span>	"Multiple FM",600,600
	<span class="opc">FLslidBnk2</span> "mod1@mod2@mod3@amp@freq1@freq2@freq3@freqPo", giElem, giOutTab2, giConfigTab, 400, 500, 100, 10
giHandle	<span class="opc">FLslidBnkGetHandle</span> 
	<span class="opc">FLpanel_end</span>

	<span class="opc">FLrun</span>
	<span class="oblock">instr</span> 1
ktrig <span class="opc">slider8table</span>  1, giOutTab, 0, \ <span class="comment">;	ctl	min	max	init	func</span>
	27,	1, 	500,	3,	<span class="op">-</span>1,	\ <span class="comment">;1 repeat rate</span>
	28,	1, 	500,	4,	<span class="op">-</span>1,	\ <span class="comment">;2 random freq. amount</span>
	29,	1, 	500,	1,	<span class="op">-</span>1,	\ <span class="comment">;3 random amp. amount</span>
	30,	1,	5000,	1,	<span class="op">-</span>1,	\ <span class="comment">;4 number of concurrent loop points</span>
\
	31,	1, 	1000,	1,	<span class="op">-</span>1,	\<span class="comment">;5 kloop1</span>
	32,	1, 	1000,	1,	<span class="op">-</span>1,	\<span class="comment">;6 kloop2</span>
	33,	1, 	1000,	1,	<span class="op">-</span>1,	\<span class="comment">;7 kloop3</span>
	34,	1, 	1000,	1,	<span class="op">-</span>1	<span class="comment">;8 kloop4</span>
kmodindex1	<span class="opc">init</span>	0
kmodindex2	<span class="opc">init</span>	0
kmodindex3	<span class="opc">init</span>	0
kamp	<span class="opc">init</span>	0
kfreq1	<span class="opc">init</span>	0
kfreq2	<span class="opc">init</span>	0
kfreq3	<span class="opc">init</span>	0
kfreq4	<span class="opc">init</span>	0
          <span class="opc">vtable1k</span>  giOutTab2, kmodindex1, kmodindex2, kmodindex3, kamp, kfreq1, kfreq2, kfreq3, kfreq4
<span class="comment">;	 *kflag, *ihandle, *ifn, *startInd, *startSlid, *numSlid;</span>
	<span class="opc">FLslidBnk2Setk</span>  ktrig, giHandle, giOutTab, 0, 0, giElem
<span class="opc">printk2</span> kmodindex1
<span class="opc">printk2</span> kmodindex2,10
<span class="opc">printk2</span> kmodindex3,20
<span class="opc">printk2</span> kamp,30
amod1	<span class="opc">oscili</span>	kmodindex1, kfreq1, giSine
amod2	<span class="opc">oscili</span>	kmodindex2, kfreq2, giSine
amod3	<span class="opc">oscili</span>	kmodindex3, kfreq3, giSine
aout	<span class="opc">oscili</span>	kamp,       kfreq4<span class="op">+</span>amod1<span class="op">+</span>amod2<span class="op">+</span>amod3, giSine
	<span class="opc">outs</span>	aout, aout
	<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">i</span>1 0 3600
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp107980096"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="FLslider.html" title="FLslider"><em class="citetitle">FLslider</em></a>,
      <a class="link" href="FLslidBnkGetHandle.html" title="FLslidBnkGetHandle"><em class="citetitle">FLslidBnkGetHandle</em></a>,
      <a class="link" href="FLslidBnk.html" title="FLslidBnk"><em class="citetitle">FLslidBnk</em></a>,
      <a class="link" href="FLslidBnk2.html" title="FLslidBnk2"><em class="citetitle">FLslidBnk2</em></a>,
      <a class="link" href="FLvslidBnk.html" title="FLvslidBnk"><em class="citetitle">FLvslidBnk</em></a>,
      <a class="link" href="FLvslidBnk2.html" title="FLvslidBnk2"><em class="citetitle">FLvslidBnk2</em></a>
      <a class="link" href="FLslidBnkSet.html" title="FLslidBnkSet"><em class="citetitle">FLslidBnkSet</em></a>,
      <a class="link" href="FLslidBnk2Set.html" title="FLslidBnk2Set"><em class="citetitle">FLslidBnk2Set</em></a>,
      <a class="link" href="slider8table.html" title="slider8table"><em class="citetitle">slider8table</em></a>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp107989792"></a>
        <h2>Credits</h2>
        <p>Author: Gabriel Maldonado</p>
        <p>New in version 5.06</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="FLslidBnk2Set.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="FLslider.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">FLslidBnk2Set </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> FLslider</td>
        </tr>
      </table>
    </div>
  </body>
</html>
